import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        // 创建Spring容器
        ApplicationContext context = new FileSystemXmlApplicationContext("classpath:applicationContext.xml");

        // 获取PersonMan对象
        PersonMan personMan1 = (PersonMan) context.getBean("personMan1");
        PersonMan personMan2 = (PersonMan) context.getBean("personMan2");

        // 打印对象信息
        System.out.println("使用属性注入的PersonMan对象：");
        System.out.println(personMan1);

        System.out.println("使用构造器注入的PersonMan对象：");
        System.out.println(personMan2);
    }
}
